<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="/css/main.css">
	<link rel="stylesheet" href="/css/font-awesome/css/font-awesome.css">
</head>
<body>
<div class="box">
	<h3>房屋信息管理</h3>
	<div class="actions">
		<div>
			<a class="btn btn-primary" href="/flats/toAdd">添加房屋信息</a>
		</div>
	</div>

	<table class="list">
		<tr>
			<th>序号</th>
			<th>所属地区</th>
			<th>所属小区</th>
			<th>单元号</th>
			<th>所属楼层</th>
			<th>房间号</th>
			<th>面积</th>
			<th>朝向</th>
			<th>限住人数</th>
			<th>出租价格(元)</th>
			<th>出租状态</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${flats.list}" var="flat">
			<tr>
				<td>${flat.h_id}</td>
				<td>${flat.h_area}</td>
				<td>${flat.h_estate}</td>
				<td>${flat.h_unitNumber}</td>
				<td>${flat.h_floor}</td>
				<td>${flat.h_roomNo}</td>
				<td>${flat.h_acreage}</td>
				<td>${flat.h_direction}</td>
				<td>${flat.h_limit}</td>
				<td>${flat.h_price}</td>
				<td>${flat.h_status=="1"?"已出租":"未出租"}</td>
				<td>
					<a class="fa fa-info" title="详情" href="/flats/detail?id=${flat.h_id}"></a>
					&nbsp;&nbsp;
					<a class="fa fa-pencil" title="编辑" href="/flats/toEdit?id=${flat.h_id }"></a>
					&nbsp;&nbsp;
					<a class="fa fa-remove" title="删除" href="/flats/del?id=${flat.h_id }" onclick="confirmDelete(1)"></a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<div class="pager-info">
		<div>共有 ${flats.total} 条记录，第 ${flats.pageNum }/${flats.pages} 页 </div>
		<div>
			<ul class="pagination">
				<li class="paginate_button previous disabled }">
					<c:if test="${flats.hasPreviousPage}">
						<a href="/flats/list?currentPage=${flats.prePage}">上一页</a>
					</c:if>
				</li>
				<li class="paginate_button active"><a href="#">${flats.pageNum}</a></li>
				<li class="paginate_button next disabled">
					<c:if test="${flats.hasNextPage}">
						<a href="/flats/list?currentPage=${flats.nextPage}">下一页</a>
					</c:if>
				</li>
			</ul>
		</div>
	</div>
</div>
<script src="js/jQuery.js"></script>
<script>
function confirmDelete(id){
	if (confirm("确定要删除码？")) {
	}
	return false;
}
</script>
</body>
</html>